<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>当日考勤</title>

    <link rel="stylesheet" href="<%= basePath%>/lib/sui.min.css">
    <link rel="stylesheet" href="<%= basePath%>/lib/sui-append.min.css">
    <link rel="stylesheet" href="<%= basePath%>/public/iconfont/iconfont.css">
    <link rel="stylesheet" href="<%= basePath%>/public/css/style.css">
    <link rel="stylesheet" href="<%= basePath%>/public/css/reset.css">
    <link rel="stylesheet" href="<%= basePath%>/modules/leader/css/style.css">

    <script type="application/javascript" src="<%= basePath%>/lib/jquery.min.js"></script>
    <script type="application/javascript" src="<%= basePath%>/lib/sui.min.js"></script>
    <script type="application/javascript" src="<%= basePath%>/lib/underscore-min.js"></script>

    <script type="application/javascript" src="<%= basePath%>/public/js/util.js"></script>
    <script type="application/javascript" src="<%= basePath%>/modules/leader/js/leader.js"></script>
    <script type="application/javascript" src="<%= basePath%>/modules/leader/js/query.js"></script>

</head>

<body class="page_body">

<% include ../../public/header.ejs %>
<% include ../../public/slogan.ejs %>
<% include ../public/tab_bar.ejs %>

<div class="content">
    <% include ../public/menu.ejs %>

    <div class="frame body">
        <div class="body_breadcrumb">
            <div class="body_line"></div>
            <p class="breadcrumb_text">
                考勤系统 > 考勤管理 > <span class="breadcrumb_text_current">当日考勤</span>
            </p>
        </div>

        <div class="body_scroll">
            <!--2 校长 当日考勤 吴亚-->
            <div class="frame-content">
                <ul class="info_list">
                    <li class="li_header">考勤报表</li>

                    <li class="li_info">
                        <%=school.name%>
                    </li>
                    <li class="li_footer">
                        <div class="table_header_class_detail">
                            年级人数：<%=school.peopleCount%>
                        </div>
                        <div class="table_header_class_detail">
                            当日出勤：<%=school.statistics.attendCount%>
                        </div>
                        <div class="table_header_class_detail">
                            出勤率：<%=Number(school.statistics.attendCount / school.peopleCount * 100).toFixed(2)%>%
                        </div>
                        <div class="table_header_class_detail alert">
                            当日缺勤：<%=school.statistics.totalAbsence%>
                        </div>
                        <div class="table_header_class_detail">
                            迟到人数：<%=school.statistics.lateCount%>
                        </div>
                        <div class="table_header_class_detail">
                            早退人数：<%=school.statistics.earlyCount%>
                        </div>
                        <div class="table_header_class_detail">
                            请假人数：<%=school.statistics.restCount%>
                        </div>
                        <div class="table_header_class_detail alert">
                            旷课人数：<%=school.statistics.absenceCount%>
                        </div>
                        <div style="clear: both"></div>
                    </li>
                    <li class="li_header">当日考勤</li>
                    <li class="li_info">
                        <span class="iconfont" style="color: #5396f1">&#xe61f;</span>
                        年/班级：
                    <span class="sui-dropdown dropdown-bordered table_header">
                    <span class="dropdown-inner">
                        <a role="button" data-toggle="dropdown" class="dropdown-toggle">
                            <i class="caret"></i>
                            <span id="inner-select" data-type="school" data-id="<%=school.id%>">
                                全校
                            </span>
                        </a>
                        <ul role="menu" aria-labelledby="status_drop" class="sui-dropdown-menu">
                            <li role="presentation">
                                <a role="menuitem" data-type="school" data-id="<%=school.id%>" tabindex="-1" onclick="innerSelectClicked(event)">
                                    全校
                                </a>
                            </li>
                            <% school.grades.forEach(function(grade) {%>
                            <li role="presentation" class="dropdown-submenu">
                                <a role="menuitem" tabindex="-1">
                                    <i class="iconfont icon-arrow1 pull-right"></i>
                                    <%=grade.name%>
                                </a>
                                <ul class="sui-dropdown-menu">
                                    <li role="presentation">
                                        <a role="menuitem" tabindex="-1" data-type="grade" data-id="<%=grade.id%>" onclick="innerSelectClicked(event)">
                                            <%=grade.name%>全部
                                        </a>
                                    </li>
                                    <% grade.natureClasses.forEach(function(natureClass) { %>
                                    <li role="presentation">
                                        <a role="menuitem" tabindex="-1" data-type="class" data-id="<%=natureClass.id%>" onclick="innerSelectClicked(event)">
                                            <%=natureClass.name%>
                                        </a>
                                    </li>
                                    <%});%>
                                </ul>
                            </li>
                            <% }); %>
                        </ul>
                    </span>
                </span>
                        <a class="btn-search sui-btn btn-primary table_header_search">查询</a>
                    </li>
                    <li class="li_footer">
                        <div class="table_content_div">
                            <table class="sui-table table-zebra attend_table leader_table_body table-bordered">
                                <thead>
                                <tr>
                                    <th>班级</th>
                                    <th>应到</th>
                                    <th>实到</th>
                                    <th>迟到</th>
                                    <th>早退</th>
                                    <th>旷课</th>
                                    <th>请假</th>
                                    <th>出勤率</th>
                                </tr>
                                </thead>
                                <tbody>
                                <% school.grades.forEach(function(grade) { %>
                                <% grade.natureClasses.forEach(function(natureClass) {
                                    var statistics = natureClass.statistics;
                                    var totalPercent = statistics.attendCount / natureClass.students.length;
                                %>
                                <tr data-grade="<%=grade.id%>" data-class="<%=natureClass.id%>">
                                    <td><%=natureClass.name%></td>
                                    <td><%=natureClass.students.length%></td>
                                    <td><%=statistics.attendCount%></td>
                                    <td><%=statistics.lateCount%></td>
                                    <td><%=statistics.earlyCount%></td>
                                    <td><%=statistics.absenceCount%></td>
                                    <td><%=statistics.restCount%></td>
                                    <td><%=Number(totalPercent * 100).toFixed(2)%>%</td>
                                </tr>
                                <% }); %>
                                <% }); %>
                                </tbody>
                            </table>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>